<body>

	<!-- TOP BAR -->
	<div id="top-bar">
		
		<div class="page-full-width cf">

			<ul id="nav" class="fl">
	
				<li class="v-sep"><?=anchor('home/index','Xem website',array('class'=>'round button dark ic-left-arrow image-left','target'=>'_blank'));?></li>
				<li class="v-sep"><a href="#" class="round button dark menu-user image-left">Chào <strong>admin</strong></a>
					<ul>						
						<li><a href="<?=site_url('admin/settings') ?>">Thông tin cửa hàng</a></li>
						<li><a href="<?=site_url('admin/event') ?>">Sự kiện</a></li>
						<li><a href="<?=site_url('admin/password') ?>">Thay đổi mật khẩu</a></li>
						<li><?=anchor('admin/logout','Thoát') ?></li>
					</ul> 
				</li>
			
				<!--<li><a href="#" class="round button dark menu-email-special image-left">3 new messages</a></li>-->
				<li><?=anchor('admin/logout','Thoát',array('class'=>'round button dark menu-logoff image-left')); ?></li>
				
			</ul> <!-- end nav -->

					
			<form action="#" method="POST" id="search-form" class="fr">
				<fieldset>
					<input type="text" id="search-keyword" class="round button dark ic-search image-right" placeholder="Search..." />
					<input type="hidden" value="SUBMIT" />
				</fieldset>
			</form>

		</div> <!-- end full-width -->	
	
	</div> <!-- end top-bar -->
	
	
	
	<!-- HEADER -->
	<div id="header-with-tabs">
		
		<div class="page-full-width cf">
	
			<ul id="tabs" class="fl">
				<li><?=anchor('admin/index','Sản phẩm',array('class'=>'active-tab dashboard-tab')); ?></li>
				<li><?=anchor('admin/newCategory','Danh mục'); ?></a></li>
				<li><?=anchor('admin/ads','Quảng cáo')?></li>
			</ul> <!-- end tabs -->
			
			<!-- Change this image to your own company's logo -->
			<!-- The logo will automatically be resized to 30px height. -->
			<a href="#" id="company-branding-small" class="fr"><img src="<?=base_url($template_path.'images/company-logo.png') ?>" alt="Blue Hosting" /></a>
			
		</div> <!-- end full-width -->	

	</div> <!-- end header -->
	
	
	
	<!-- MAIN CONTENT -->
	<div id="content">
		
		<div class="page-full-width cf">

			<div class="side-menu fl">
				
				<h3>Danh mục</h3>
				<ul>
					<?php
						foreach( $categories as $category )
						{
							echo '<li>'.anchor('admin/index/'.$category['id'],$category['category']).'</li>';
						}
					?>
				</ul>
				
			</div> <!-- end side-menu -->
			
			<div class="side-content fr">
			
				<div class="content-module">
				
					<div class="content-module-heading cf">
					
						<h3 class="fl">Sản phẩm</h3>
						<span class="fr expand-collapse-text">Thu nhỏ</span>
						<span class="fr expand-collapse-text initial-expand">Mở rộng</span>
					
					</div> <!-- end content-module-heading -->
					
					
					<div class="content-module-main">

						<div class="content-module-main">
						<?php 
							if( isset($notify) && !empty($notify) ):
						?>
							<div class="confirmation-box round"><?=$notify; ?></div>
						<?php
							endif;
						?>
						</div> <!-- end content-module-main -->
						
						<ul class="temporary-button-showcase">
							<li><?=anchor('admin/newProduct','Thêm sản phẩm mới',array('class'=>'button round blue image-right ic-add text-upper')) ?></li>							
						</ul>
					
						<table>
						
							<thead>
						
								<tr>
									<th><input type="checkbox" id="table-select-all"></th>
									<th>Product</th>
									<th>Price</th>
									<th>Image</th>
									<th>Actions</th>
								</tr>
							
							</thead>
	
							<tfoot>
							
								<tr>
								
									<!-- <td colspan="5" class="table-footer">
									
										<label for="table-select-actions">With selected:</label>
	
										<select id="table-select-actions">
											<option value="option1">Delete</option>
											<option value="option2">Export</option>
											<option value="option3">Archive</option>
										</select>
										
										<a href="#" class="round button blue text-upper small-button">Apply to selected</a>	
	
									</td> -->
									
								</tr>
							
							</tfoot>
							
							<tbody>
							<?php
								foreach( $products as $product ):								
							?>
								<tr>
									<td><input type="checkbox"></td>
									<td><?=$product['name']; ?></td>
									<td><?=$product['price']; ?></td>
									<td><img src='<?=base_url('upload/image/products/'.$product['thumbnail']) ?>' /></td>
									<td>
										<a href="<?=site_url('admin/editProduct/'.$product['id']) ?>" class="table-actions-button ic-table-edit"></a>
										<a href="<?=site_url('admin/deleteProduct/'.$product['id']) ?>" class="table-actions-button ic-table-delete" onClick="return confirm('Bạn có chắc sẽ xóa dữ liệu này?')"></a>
									</td>
								</tr>								
							<?php
								endforeach;
							?>
							</tbody>
							
						</table>
					
					</div> <!-- end content-module-main -->
					<?=$products_paging; ?>
				
				</div> <!-- end content-module -->													
		
			</div> <!-- end side-content -->
		
		</div> <!-- end full-width -->
			
	</div> <!-- end content -->